window.onload=function(){
    $('#sub').click(function(){
        let password = $($('.msg>div>div>input')[0]).val();
        let newpwd = $($('.msg>div>div>input')[1]).val();
        let yespwd = $($('.msg>div>div>input')[2]).val();
        if(newpwd == yespwd){
            $.ajax({
                url:'/sider/changepwd',
                method:'post',
                data:{password:password,newpwd:newpwd},
                success:function(res){
                    if(res.state){
                        location.href='/pages/xitongshouye--shikaiwen/shouye.html'
                    }else{
                        alert("修改失败")
                    }
                }
            })
        }else{
            alert('两次密码不一样')
        }
        
    })
}